import request from "@/utils/request";

/***************云当铺-start*************************/

/*
 * 根据寄存天数&寄存金额获取首单和非首单的服务费
 * */
export function getServiceFeeByDays(data) {
  return request.post('/sy/calculator/getServiceFeeByDays',data)
}


/*
 * 商城app1.1.0：获取获取产品列表
 * */
export function getShopProductsPageList(data) {
  return request.get('/sy/shop/getProducts/list',data || {})
}

/*
 * 商城app1.1.0：获取产品价格区间和成色和分类
 * */
export function getPriceIntervalFinenessList(data) {
  return request.get('/sy/shop/getPriceCate/finenessList')
}

/**
 * 商城app1.1.0：商城-获取商品分类：1级和2级
 * @returns {*}
 */
export function getCateListList(id) {
  return request.get("/sy/shop/getCateList/" + id);
}

/**
 * 文章和图文详情
 * @returns {*}
 */
export function getSyArticleDetails(id) {
  return request.get("/sy/getArticle/" + id, {}, { login: false });
}

/**
 * 获取关于我们信息
 * @returns {*}
 */
export function getAboutUs() {
	return request.get("/sy/aboutUs/info", {}, { login: true });
}

/**
 * 获取平台统计各个单子和用户量
 * @returns {*}
 */
export function getSyOrderCount() {
	return request.get("/sy/user/getSyOrderCountInfo", {}, { login: true });
}

/**
 * 获取各自统计邀请用户量
 * @returns {*}
 */
export function getInviteCount(data) {
	return request.post("/sy/myUser/getInviteCountInfo",data, {
		login: true
	})
}

export function getgetDateTimeOrderCount(data) {
	return request.post("/sy/user/getDateTime/syOrderCountInfo",data, {
		login: true
	})
}

/**
 * 获取openLink
 * @returns {*}
 */
export function getOpenLink() {
	return request.get("/sy/aboutUs/getScheme", {}, { login: true });
}

/**
 * 商城app1.1.0：首页
 * @returns {*}
 */
export function getSyHomeData(phoneModel) {
	return request.get("/sy/shop/index", {}, {
		login: false
	});
}

/**
 * 报价单1.1.0
 * @returns {*}
 */
export function getRecoverydetails() {
  return request.get("/sy/getRecovery/offer/details");
}

/**
 * 报价单1.1.0
 * @returns {*}
 */
export function getRecoverydetailsImages(id) {
  return request.get("/sy/getRecovery/offer/details/images/" + id);
}

/*
 * 提交回收报价咨询
 * */
export function getRecoveryOfferInfo(data) {
  return request.post('/sy/business/recoveryOffer/submit',data)
}

/*
 * 用户咨询报价列表
 * */
export function getUserOfferNewsList(data) {
  return request.get('/sy/offer/getUserOfferNews/list', data || {})
}

/*
 * 报价回复人员提交操作
 * */
export function getReply(data) {
  return request.post('/sy/offer/reply/submit', data || {})
}

/***************云当铺-end*************************/


/**
 * 首页
 * @returns {*}
 */
export function getCanvas() {
  return request.get("/getCanvas?terminal=3", {}, { login: false });
}

/**
 * 文章 轮播列表
 * @returns {*}
 */
export function getArticleBanner() {
  return request.get("/article/banner/list", {}, { login: false });
}

/**
 * 文章分类列表
 * @returns {*}
 */
export function getArticleCategory() {
  return request.get("/article/category/list", {}, { login: false });
}

/**
 * 文章 热门列表
 * @returns {*}
 */
export function getArticleHotList() {
  return request.get("/article/hot/list", {}, { login: false });
}

/**
 * 文章列表
 * @returns {*}
 */
export function getArticleList(q) {
  return request.get("/article/list/", q, { login: false });
}

/**
 * 文章类型（0：banner、1：app协议、2：新手必读、3：常见问题、4：热门问题、5：咨询文章）
 * @returns {*}
 */
export function getSyArticleList(q) {
  return request.get("/sy/getArticleList?articleType="+q);
}

/**
 * 分享
 * @returns {*}
 */
export function getShare() {
  return request.get("/share", {}, { login: false });
}

/**
 * 文章详情
 * @returns {*}
 */
export function getArticleDetails(id) {
  return request.get("/article/details/" + id, {}, { login: false });
}

/**
 * 获取微信sdk配置
 * @returns {*}
 */
export function getWechatConfig() {
  return request.get(
    "/wechat/config",
    { url: location.href },
    { login: false }
  );
}

/**
 * 获取微信sdk配置
 * @returns {*}
 */
export function wechatAuth(code, spread, login_type) {
  return request.get(
    "/wechat/auth",
    { code, spread, login_type },
    { login: false }
  );
}
/**
 * 获取快递公司
 * @returns {*}
 */
export function getLogistics() {
  return request.get("/logistics", {}, { login: false });
}

